<?php $id="form_".uniqid();?>
<table id="<?php echo $id;?>"></table>
<script>
    $("#<?php echo $id;?>").DataSource({url:'useranalyse/get_bet_list',
        fields:[
            [
                {field:'username', title:'会员账号', align:'center',width:100,sortable:true},
                {field:'agent',title:'代理商', align:'center', width:100, sortable:false},
                {field:'total_bet',title:'总投注',align:'center', width:100, sortable:true},
                {field:'total_valid_bet',title:'有效投注', align:'center',width:120, sortable:true},
                {field:'win',title:'总派彩', align:'center' , width:120, sortable:true},
                {field:'total_count',title:'总笔数', align:'center', width:100,  sortable:true},
                {field:'win_count',title:'赢（笔）', align:'center',width:150,  sortable:true},
                {field:'lose_count',title:'输（笔）', align:'center', width:120,  sortable:true},
                {field:'win_percent',title:'胜率', align:'center',width:100,  sortable:true},
                {field:'level', title:'等级', align:'center',width:200,sortable:false},
                {field:'result', title:'结果', align:'center',width:200,sortable:false}
            ]

        ], tools:[
            {instant:false},
            <?php if(in_array('ADD',$auth)){?>
            {text:"新增层级",iconCls:"icon-add",handler:function(){
                $('#<?php echo $id?>').DataSource('add',{title:'新增层级',get:'level/edituser?>',full:true});
            }},
            <?php }?>
                {type:'combobox',text:'类型',width:100,name:'type',value:'', items:'<option value="1">彩票</option><option value="2">代理账号</option>'},
                {type:'datebox', text:'注册日期', width:100,name:'qaddtime'},
                {type:'datebox', text:'-', width:100,name:'sdate'},
                {type:'textbox', text:'-', width:100,name:'edate'},
                {text:"搜索", iconCls:"icon-search", handler:function(){
                    $('#<?php echo $id?>').DataSource('search');
                }},
            '-'
        ],
        checkbox:false,
        edit:true,
        footer:true,
        success:function(){

        }
    });

    function edit_pay_type()
    {
        Core.dialog('支付设定','level/pay_set',function(){},true,false);
    }
</script>